<?php defined('IN_NWIDC') or exit('Access Invalid!');?> 
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/base.css" rel="stylesheet" type="text/css">
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/home_header.css" rel="stylesheet" type="text/css">
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/member_login.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/shop/templates/mln/font/css/font-awesome.css">
<style>
    body {
    <?php $item = tpl_get("基本设置");?> background: <?php echo $item[0]['color']?> !important;
    }
</style>
<style>
  .nc-login-layout{
    width: 940px;
    padding: 40px;
    background:#fff;
    border-radius: 5px;
  }
  .nc-login-layout .left-pic{
    float: right;
    width: 400px;
  }
  .nc-login{
    float: left;
    border:0;
    width: 460px;
    padding: 19px 39px 49px 39px;
  }
  .tabs-nav li{
    text-align: left;
    line-height: 40px;
  }
  .tabs-nav li h3{
    font-size: 30px;
    color:#000;
    font-weight: bold;
  }
  .tabs-nav li span{
    font-size: 14px;
  }
  .tabs-nav li span a,.tabs-nav li span a:hover{
    font-size: 14px;
    color:#ff731a;
  }
  .tabs-nav li._last{
    text-align: right;
  }
  .tabs-nav{
    border-bottom:0;
  }
  .nc-login .tabs-container{
    padding: 0;
  }
  .nc-login .nc-login-form dl{
    width: 468px;
    border:0;
    border-bottom:1px solid #E6E6E6;
    margin-top: 0;
  }
  .nc-login-form dl dt{
    padding-bottom: 3px;
    padding-top: 29px;
    padding-left: 5px;
    width: 30px;
  }
  .nc-login-form dl dt i{
    font-size: 18px;
    color:#999;
  }
  .nc-login-form dl dd{
    padding: 0;
    padding-top: 24px;
  }
  .nc-login .tabs-content{
    width: 472px;
  }
  .nc-login .nc-login-form dl dd .text{
    width: 420px;
  }
  .handle-div{
    font-size: 14px;
  }
  .nc-login .nc-login-form .submit-div .submit{
    width: 228px;
  }
  .nc-login-form .submit-div .submit{
    height: 35px;
    font-weight: normal;
    background-color: #ff751a;
    border: solid 1px #ff751a;
  }
  .left-pic{
    text-align: right;
    padding-top: 9px;
  }
  .left_content{
    float: right;
    width: 240px;
    text-align: center;
  }
  ._title h3{
    font-size: 20px;
    font-weight: bold;
    color:#000;
    height: 30px;
    line-height: 30px;
  }
  ._line{
    height: 36px;
    /*padding-left: 30px;*/
    width: 200px;
    margin-left: 20px;
  }
  ._line_left,._line_right{
    float: left;
    height: 18px;
    border-bottom:1px solid #b8b8b8;
    width: 40px;
  }
  ._line_middle{
    float: left;
    width: 120px;
    height: 36px;
    line-height: 36px;
    font-size: 14px;
    color: #999;
  }
  ._signin_icon{
    width: 200px;
    margin-left: 20px;
    margin-top: 5px;
  }
  ._qq,._weibo,._weixin{
    float: left;
    width: 100px;
  }
  ._qq div,._weibo div,._weixin div{
    width: 64px;
    height: 64px;
    border-radius: 100px;
    margin-left: 15px;
    line-height: 80px;
  }
  ._qq div{
    background:url(/shop/templates/mln/images/qq.png) no-repeat center;
    border-radius:0;
  }
  ._weibo div,._weixin div{
    border:2px solid #cdcdcd;
  }
  .icon-weibo{
    font-size: 36px;
    color:#71c9a3;
  }
  .a1{
    display: block;
    width: 64px;
    height: 64px;
  }
  .a3:hover{
    text-decoration: none;
  }
  body #footer{
    display: block !important;
    border-top: 0 !important;
  }
  .fa-weixin{
    font-size: 36px;
    color:#72c8a1;
  }
</style>
<div class="logon wrapper" style="width:1020px;height:100px;padding-top:10px;">
    <?php
    $img = tpl_get("logo");

    ?>
    <a href="<?php echo $img['link'] ?>">
        <img src="<?php echo $img['pic'] ?>" alt="" style="width: 160px;height: 100px;float: left;">
    </a>
</div>

<link rel="stylesheet" href="/shop/templates/default/home/register/Css/common.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="/shop/templates/default/home/register/Css/jumei_sign.css" type="text/css" media="screen" charset="utf-8" />
<script src="/shop/templates/default/home/register/Scripts/es5-shim.js"></script>
<script src="/shop/templates/default/home/register/Scripts/es5-sham.js"></script>



<style>
    #footer{
        display: none !important;
    }
    #footer.wrapper{
        display: block !important;
    }
</style>



<!-- <script src="/shop/templates/default/home/register/Scripts/website.min.js"></script> -->
<!-- <script src="/shop/templates/default/home/register/Scripts/boot.js"></script> -->
<script src="/shop/templates/default/home/register/Scripts/jquery.cookie.js"></script>

<script>
    
</script>

<style>
    .top_nav_hot{ position: absolute;left:81px;top:-4px;}
    .loginWrap{
        margin-bottom: 150px !important;
    }
</style>

<script>
$(document).ready(function () {
$(".top_hot").hover(function () {
$(".top_nav_hot").css("display","none")
},
function () {
$(".top_nav_hot").css("display","block")
}
);
});
</script>

<link href="/shop/templates/default/home/register/Css/signup.css" rel="stylesheet"/>
<script>
 var REDIRECT = '';
 var IS_OPEN_PASSPORT = true;
</script>
<script>
    // seajs.use('signup/index', function() {});
</script>
<style>
  .loginBord{
    left: 0;
  }
  .loginWrap{
    margin-top: 0;
    width: 500px;
  }
  .loginPic{
    width: 500px;
  }
  .loginWrap .loginBord{
    top: 0;
    width: 470px;
    padding: 0;
  }
  .loginWrap .loginBord{
    box-shadow: none;
  }
  .loginTit strong{
    color:#000;
    font-size: 30px;
  }
  .tosignup a{
    color:#ff751a;
  }
  .textbox_ui input:focus{
    box-shadow: none;
    border:0;
  }
  .sign .error_ui input{
    box-shadow: none;
    border:0;
  }
  .textbox_ui input{
    border:0;
  }
  .textbox_ui input{
      height: 20px !important;
  }
</style>
<div class="nc-login-layout">
<div class="left-pic">
    <div class="left_content">
      <div class="_title">
        <h3>第三方帐号登录</h3>
      </div>
      <div class="_line">
        <div class="_line_left"></div>
        <div class="_line_middle">
          Sign in with
        </div>
        <div class="_line_right"></div>
      </div>
      <div class="_signin_icon">
      <?php if ($output['setting_config']['qq_isuse'] == 1){?>
          <div class="_qq">
          
            <div>
              <a href="<?php echo SHOP_SITE_URL;?>/api.php?act=toqq" class="a1" title="QQ"></a>
            </div>
          
          </div>
          <?php }?>
          <?php if ($output['setting_config']['sina_isuse'] == 1){?>
          <div class="_weibo">
            <div>
            
            <a href="<?php echo SHOP_SITE_URL;?>/api.php?act=tosina" class="a3" title="新浪微博">
              <i class="icon-weibo"></i>
              </a>
              
            </div>
          </div>
          <?php }?>
          <?php
                require_wechat();
                require_once(dirname(BASE_PATH) . '/wxpay/lib/WxPay.Config.php');
                $wechat = new WeChat(-1);
                $redirect = urlencode('http://' . $_SERVER['HTTP_HOST'] . '/shop/index.php?act=login&op=wechat_login');
                if(isset($_SESSION['wechat_openid'])){
                    if(time() - $_SESSION['wechat_openid']['time'] < 300){
            ?>
            <script>
                $('[name=ref_url]').val('');
            </script>
            <?php
                    }
                }
                $url = "https://open.weixin.qq.com/connect/qrconnect?appid={$wechat->config['open_appid']}&redirect_uri={$redirect}&response_type=code&scope=snsapi_login&state=STATE#wechat_redirect";
            ?>
          <div class="_weixin">
            <div>
            
            <a href="<?php echo $url;?>" class="a6" title="微信"><i class="fa fa-weixin"></i></a>
              <?php //}?>
            </div>
          </div>
          <div class="clear"></div>
      </div>
    </div>
  </div>
<div class="sign registerpage nc-login">
    <div class="loginWrap">
        <style>
            .loginPic{
                background: none !important;
            }
            .line div{
              float: left;
            }
            .line{
              border-bottom:1px solid #E6E6E6;
            }
            .text_i{
              padding-left: 5px;
              height: 44px;
              line-height: 63px;
              width: 30px;
            }
            .text_i i{
              font-size: 16px;
              color:#999;
            }
            .focus_text{
              display: none !important;
            }
            .sign .act, .sign .line{
              margin-bottom: 18px;
            }
            .textbox_ui input{
              height: 40px;
              padding: 0;
              /*line-height: 60px;*/
            }
        </style>
        <div class="loginPic " style='position: relative;'>
            <div class="loginBord">
                <div class="loginTit">
                    <div class="tosignup">已有账号?<a href="?act=login&op=login">马上登录</a></div>
                    <h1><strong>新用户注册</strong></h1>
                </div>
                <form id="phone" method="post"  action="/shop/index.php?act=login&op=usersave">
                    <input type='hidden' name='formhash' value='_WVnRES5Ba2a7ULA4AGVooS0G1Cyqm7' /> 
                    <div class="line">
                        <div class="text_i">
                          <i class="icon-user"></i>
                        </div>
                        <div class="textbox_ui">
                            <input type="text" id="user_name" name='user_name' placeholder="请输入用户名" autofocus autocomplete="off" value="">
                            <div class="focus_text">请输入6-16位的字母/数字</div>
                            <div class="invalid">
                                <i></i>
                                <div class="msg"></div>
                            </div>
                            <i class="valid"></i>
                            <i class="loading"></i>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="line">
                        <div class="text_i">
                          <i class="icon-lock"></i>
                        </div>
                        <div class="textbox_ui">
                            <input type="password" placeholder="请输入六位以上密码" name='password' id="password" autocomplete="off">
                            <div class="focus_text">
                                <p class="default">6-16个字符，建议使用字母加数字或符号组合</p>
                                <!-- <div class="safe">
                                    <div class="pw_isstrong clearfix">
                                        <div class="pw_level pw_success" data-class="pw_weak" data-strength="weak">弱</div>
                                        <div class="pw_level pw_success" data-class="pw_normal" data-strength="normal">中</div>
                                        <div class="pw_level pw_success" data-class="pw_strong" data-strength="strong" style="border-right:0">强</div>
                                    </div>
                                </div> -->
                            </div>
                            <i class="valid"></i>
                            <div class="invalid">
                                <i></i>
                                <div class="msg"></div>
                            </div>
                        </div>
                    </div>
                    <div class="line">
                        <div class="text_i">
                          <i class="icon-lock"></i>
                        </div>
                        <div class="textbox_ui">
                            <input type="password" id="password2" name='password_confirm' placeholder="请在此输入密码确认" autocomplete="off">
                            <div class="focus_text">请再次输入密码</div>
                            <i class="valid"></i>
                            <div class="invalid">
                                <i></i>
                                <div class="msg"></div>
                            </div>
                        </div>
                    </div>
                    <div class="line verityWrap" style="width:267px;">
                        <div class="text_i">
                          <i class="icon-check-sign"></i>
                        </div>
                        <div class="textbox_ui">
                            <input type="text" placeholder="请输入右侧图形码" name='captcha' id="verify_code" autocomplete="off">
                            <div class="focus_text">按右图填写，不区分大小写</div>
                            <div class="invalid">
                                <i></i>
                                <div class="msg"></div>
                            </div>
                        </div>
                        <span id="change_verify_code" onclick="document.getElementById('codeimage2').src='index.php?act=seccode&op=makecode&nchash=6bda07d8&t=' + Math.random();">
                            <img height='30' width='86' id='codeimage2' src="index.php?act=seccode&op=makecode&nchash=435afca7" >
                            看不清,换一张
                        </span>
                    </div>
                    <div class="line ">
                        <div class="text_i">
                          <i class="icon-mobile-phone"></i>
                        </div>
                        <div class="textbox_ui">
                            <input type="text" placeholder="请输入手机号" name='mobile_phone' id="mobile_phone" autocomplete="off">
                            <div class="focus_text">请输入正确的手机号码</div>
                            <div class="invalid">
                                <i></i>
                                <div class="msg"></div>
                            </div>
                        </div>
                        <!-- <span id="change_verify_code" onclick="document.getElementById('codeimage').src='index.php?act=seccode&op=makecode&nchash=6bda07d8&t=' + Math.random();">
                            <img height='40' width='65' id='codeimage' src="index.php?act=seccode&op=makecode&nchash=435afca7" >
                            换一张
                        </span> -->
                    </div>
                    <style>
                      .line.verityWrap{
                        width: 337px;
                        position: relative;
                      }
                      .verityWrap .phonecode{
                        position: absolute;
                        right: -130px;
                        background:#92ccb3;
                        border:1px solid #38c789;
                        color:#fff;
                        width: 129px;
                        height: 33px;
                        line-height: 33px;
                        border-radius:3px;
                        padding: 0;
                        bottom:0;
                      }
                      #change_verify_code{
                        position: absolute;
                        right: -190px;
                        bottom:0;
                      }
                      .verityWrap img{
                        height: 30px;
                      }
                    </style>
                    <div class="line verityWrap">
                        <div class="text_i">
                          <i class="icon-link"></i>
                        </div>
                        <div class="textbox_ui sms_verify_wrapper">
                            <input type="text" id="mobile_verify" name='mobile_verify' placeholder="请输入验证码" autocomplete="off">
                                                            <div class="focus_text">请输入6位短信校验码</div>
                                                        <div class="hint"></div>
                            <div class="invalid">
                                <i></i>
                                <div class="msg"></div>
                            </div>
                        </div>
                                            <a href="javascript:;" id="getPhoneCode" class="phonecode" data-verifyType="sms"><strong>获取验证码</strong></a>
                                        </div>
                      
                    
                    <div class="line">
                        <div class="text_i">
                          <i class="icon-flag"></i>
                        </div>
                        <div class="textbox_ui">
                            <input type="text" id="invite_code" name='invite_code' placeholder="邀请码，没有可以不填" autocomplete="off">
                            <div class="focus_text">输入邀请码，没有可以不填</div>
                            <i class="valid"></i>
                            <div class="invalid">
                                <i></i>
                                <div class="msg"></div>
                            </div>
                        </div>
                    </div>
                    <div style="height:40px;position:relative;"></div>
                    <div>
                        <div>
                            <input type="checkbox" name='agreement'>
                            <span>我已阅读并遵守<a href="/shop/index.php?act=document&code=agreement" target="_blank">注册协议</a></span>
                            
                        </div>
                    </div>
                    <div style="position:relative;height:25px;"></div>
                    <div class="act" style="margin-left: 0px;">
                        <p>
                            <input type="submit" class="submit_btn" value="确认注册" name="mobileCommit" style="width: 228px;height:34px;line-height:34px;background:#ff751a;border-radius:5px;">
                        </p>
                        
                    </div>
                    <br />
                </form>
                
            </div>
        </div>
    </div>
</div>
<div class="clear"></div>


<!--*连续登陆探测 -->

<!--点击流用-->
<script type="text/javascript" charset="utf-8" src="/shop/templates/default/home/register/Scripts/clk_jumei.js"></script>
<script type="text/javascript" charset="utf-8" src="/shop/templates/default/home/register/Scripts/jumei.clickmap.js"></script>




<style>
    #footer{
        display: block !important;
    }

    #footer {
        display: none !important;
    }
    #footer.wrapper{
        display: block !important;
    }
    #footer .footer_link{
        display: block;
    }
    .loginWrap .verityWrap, .loginWrap .textbox_ui{
        margin-bottom: 0;
        margin-top: 18px;
    }
    div.line{
        margin-top: 12px !important;
    }
</style>

<script>
    var validate = function(form,rule){

        var err_list = [];

        form.submit(function(){
            if($('[name=agreement]').is(':checked') == false){
                layer.msg("请先选择同意用户协议");
                return false;
            }
            err_list = [];
            $(this).find('input').blur();
            if(err_list.length) {
                var top = err_list.shift();
                layer.msg(top);
                return false;
            }
//            if($('.error_ui').length){
//                return false;
//            }
        });


        // form.delegate('input', 'focus', function(event) {
        //     var box = $(this).parents('.textbox_ui');
        //     if(!this.getAttribute('msg')){
        //         var msg = box.find('.msg').text();
        //         this.setAttribute('msg',msg);
        //     }
        //     box.find('.msg').empty();
        //     box.removeClass('error_ui');
        //     box.find('.invalid').hide();

            
        // });
        form.delegate('input','blur',function(){
            for(var i in rule){
                if(this.id == i){
                    if(rule[i].format){
                        if(!rule[i].format[0].test(this.value)){
                            $(this).parents('.textbox_ui').addClass('error_ui').find('.msg').text(rule[i].format[1]);
                            var msg = $(this).parents('.textbox_ui').find('.invalid .msg').text();
                            err_list.push(msg);
//                            layer.msg(msg);
                            // $(this).parents('.textbox_ui').find('.invalid').show();
                            return false;
                        }
                    }
                    if(rule[i].ajax){
                        var _this = this;
                        $.post(rule[i].ajax[0],{val : $.trim(this.value)},(function(item,_this){
                            return function(msg){
                                if(msg == 'failed'){
                                    $(_this).parents('.textbox_ui').addClass('error_ui').find('.msg').text(item[1]);
                                    // $(_this).parents('.textbox_ui').find('.invalid').show();
                                    var msg = $(this).parents('.textbox_ui').find('.invalid .msg').text();
                                    err_list.push(msg);
//                                    layer.msg(msg);
                                }
                            }
                        })(rule[i].ajax,this));
                    }
                }

            }
            if(this.id == 'password'){
                if(this.value != $('#password2').val() && $('#password2').val() != ''){
                    $(this).parents('.textbox_ui').addClass('error_ui').find('.msg').text("确认密码需和密码一样！");
                    var msg = $(this).parents('.textbox_ui').find('.invalid .msg').text();
                    err_list.push(msg);
//                    layer.msg(msg);
                    // $(this).parents('.textbox_ui').find('.invalid').show();
                    return false;
                }
            }
            if(this.id == 'password2'){
                if(this.value != $('#password').val() && $('#password').val() != ''){
                    $(this).parents('.textbox_ui').addClass('error_ui').find('.msg').text("确认密码需和密码一样！");
                    var msg = $(this).parents('.textbox_ui').find('.invalid .msg').text();
                    err_list.push(msg);
//                            layer.msg(msg);
                    // $(this).parents('.textbox_ui').find('.invalid').show();
                    return false;
                }
            }
            var msg;
            if(msg = this.getAttribute('msg')){
                $(this).parents('.textbox_ui').find('.msg').text(msg);
            }
        });
    }

    var rule = {
        user_name : {
            format : [/^[\w]{6,16}$/i,"用户名格式错误，请输入6-16位的字母/数字"],
            ajax : ['index.php?act=seccode&op=checkuser','该用户名已被人注册']
        },
        password : {
            format : [/^.{6,16}$/i,'密码格式错误,请输入6-16位的字符']
        },
        password2 : {
            format : [/^.{6,16}$/i,'密码格式错误,请输入6-16位的字符']
        },
        mobile_phone : {
            format : [/^1[345789][0-9]{9}$/,'手机号码的格式错误']
        }

        // mobile_verify  : {
        //     format : [/^[0-9]{6}$/,'请输入6位短信校验码']
        // }
    }

    validate($('#phone'),rule);

    $(function(){

        var coldDown = function(elem){
            elem.unbind('click',send_message);

            var count = 60;
            var timer = setInterval(function(){
                elem.find('strong').text('重发短信（' + count + '）');

                if(--count == 0){
                    elem.bind('click',send_message);
                    elem.find('strong').text('获取短信校验码');
                    clearInterval(timer);
                }

            },1000);
        }


        var send_message = function(){
            var mobile = $.trim($('#mobile_phone').val());
            if(!/^1[345789][0-9]{9}$/.test(mobile)){
                layer.msg('请输入正确的机号码！');
            }


            var captcha_error = 0x01;
            var mobile_error = 0x01 << 1;
            var mobile_same = 0x01 << 2;
            var error = 0x01 << 3;

            var nchash = $('#codeimage2').attr('src').match(/nchash=([^&]+)/)[1]

            var index = layer.load();
            $.get('/shop/index.php?act=seccode&op=send_message',{nchash : nchash,mobile : mobile, captcha : $.trim($('#verify_code').val())},function(msg){

                console.log(msg);

                layer.close(index);

                if(msg & captcha_error){
                    layer.msg('验证码错误！');
                    return;
                }

                if(msg & mobile_error){
                    layer.msg('手机号码错误！');
                    return;
                }

                if(msg & mobile_same){
                    layer.msg('该手机号码已被注册');
                    return;
                }

                if(msg & error){
                    layer.msg('发送失败，请稍后重试！');
                    return;
                }

                //成功的处理
                layer.msg('短信发送成功');
                coldDown($('#getPhoneCode'));

            });

        }


        $('#getPhoneCode').bind('click',send_message);

    })


</script>
</div>
